<%@page import="shmged.com.shlcm.utils.CmShmgedType"%>
<%@page import="shmged.com.shlcm.utils.CmSettings"%>
<%@page import="wt.httpgw.URLFactory"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
     String baseUrl = new URLFactory().getBaseHREF();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新建用户</title>
	
</head>
<body>
<center>
<div style="display:none" >
<div style="width: 560px;" id="browseCreateUser" >
<div class="easyui-panel" title="用户信息" >
	    <form id="amCreateUser" method="post" action="<%=baseUrl %>shmged/jsp/com/shlcm/hr/createUserService.jsp" enctype="multipart/form-data">
	        <input type="hidden" name="CONFcontainerName" value="<%=CmSettings.getSection("DefaultLocation").get("ShmgedContainer", "上海海洋地质勘察设计库") %>" />
	        <input type="hidden" name="CONFfolderPath" value="<%=CmSettings.getSection("DefaultLocation").get("UserInfoEntryFoler", "/Default") %>" />
	        <input type="hidden" name="CONFsoftType" value="<%=CmShmgedType.UserInfoEntry %>" />
	    	<table border="1px" bordercolor="00BFFF" cellspacing="0px" style="border-collapse:collapse" class="easyui-panel" width="100%">
	    		<tr>
	    			<td align="right">人员编号:</td>
	    			<td ><input class="easyui-validatebox" type="text" name="MBAnumber" data-options="required:true,missingMessage:'请输入人员编号！'"></input></td>
	    			<td align="right">人员名称:</td>
	    			<td><input class="easyui-validatebox" type="text" name="MBAname" data-options="required:true,missingMessage:'请输入人员名称！'"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">年龄:</td>
	    			<td>
	    			<select class="easyui-combobox" name="IBAAge">
	    			   <c:forEach begin="16" end="80" varStatus="ageStatus">
	    			      <option value="${ageStatus.index }">${ageStatus.index }</option>
	    			   </c:forEach>
	    			 </select>
	    			</td>
	    			<td align="right">性别:</td>
	    			<td>
	    			   <input type="radio" value="男" name="IBAGender" checked="checked">男 &nbsp;&nbsp;
	    			   <input type="radio" value="女" name="IBAGender" >女
	    			</td>
	    		</tr>
	    		<tr>
	    			<td align="right">学历:</td>
	    			<td colspan="3"><input class="easyui-validatebox" type="text" name="IBAEducationalBackground" size="60"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">专业:</td>
	    			<td colspan="3"><input class="easyui-validatebox" type="text" name="IBASpecialty" size="60"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">身份证号:</td>
	    			<td colspan="3"><input class="easyui-validatebox" type="text" name="IBAIDNumber" size="60"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">岗位:</td>
	    			<td><input class="easyui-validatebox" type="text" name="IBAPost"></input></td>
	    			<td align="right">职称:</td>
	    			<td><input class="easyui-validatebox" type="text" name="IBAUserTitle"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">入职时间:</td>
	    			<td><input class="easyui-datebox" data-options="formatter:myformatter,parser:myparser" name="DATEIBAEntryTime"></input></td>
	    			<td align="right">离职时间:</td>
	    			<td><input class="easyui-datebox" data-options="formatter:myformatter,parser:myparser" name="DATEIBADepartureTime"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">籍贯:</td>
	    			<td><input class="easyui-validatebox" type="text" name="IBAHometown"></input></td>
	    			<td align="right">政治面貌:</td>
	    			<td><input class="easyui-validatebox" type="text" name="IBAPoliticalLandscape"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">手机号码:</td>
	    			<td><input class="easyui-validatebox" type="text" name="IBAPhoneNumber"></input></td>
	    			<td align="right">状态:</td>
	    			<td><input class="easyui-validatebox" type="text" name="IBAUserStatus"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">人员合同:</td>
	    			<td colspan="3"><input class="easyui-validatebox" type="text" name="IBAStaffContracts" size="60"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">体检状态:</td>
	    			<td><input class="easyui-validatebox" type="text" name="IBAPhysicalState"></input></td>
	    			<td align="right">婚姻状况:</td>
	    			<td>
	    			   <input type="radio" value="未婚" name="IBAMaritalStatus" checked="checked">未婚
	    			   <input type="radio" value="已婚" name="IBAMaritalStatus" >已婚
	    			   <input type="radio" value="其他" name="IBAMaritalStatus" >其他
	    			</td>
	    		</tr>
	    		<tr>
	    			<td align="right">家庭住址:</td>
	    			<td colspan="3"><input class="easyui-validatebox" type="text" name="IBAHomeAddress" size="60"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">户籍地址:</td>
	    			<td colspan="3"><input class="easyui-validatebox" type="text" name="IBAResidenceAddress" size="60"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">紧急联络人:</td>
	    			<td><input class="easyui-validatebox" type="text" name="IBAEmergencyContact"></input></td>
	    			<td align="right">紧急联系电话:</td>
	    			<td><input class="easyui-validatebox" type="text" name="IBAEmergencyTelephone"></input></td>
	    		</tr>
	    		<tr>
	    			<td align="right">个人经历:</td>
	    			<td colspan="3"><textarea name="IBAPersonalExperience" style="height:120px;width: 400px;"></textarea></td>
	    		</tr>
	    		<tr>
	    			<td align="right">身份证扫描件:</td>
	    			<td colspan="3">
	    			  <input type="file" name="FILE_IBA_IDScan" size="50" id="FILE_IBA_IDScan"/>
	    			</td>
	    		</tr>
	    		<tr>
	    			<td align="right">照片:</td>
	    			<td colspan="3">
	    			  <input type="file" name="FILE_IBA_Photo" size="50" id="FILE_IBA_Photo"/>
	    			</td>
	    		</tr>
	    	</table>
	    </form>
	    </div>
	    <div style="text-align:center;padding:5px">
	    	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">提交</a>
	    	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">重置</a>
	    </div>
	    <div style="display: none;">
	      <form action="<%=baseUrl %>shmged/jsp/com/shlcm/hr/viewUser.jsp" id="jumpPageId">
	          <input type="hidden" name="oid" value="" id="jumpOidId"/> 
	      </form>
	    </div>
	<script>
		function submitForm(){
			$('#amCreateUser').form('submit',{
				onSubmit:function (){
					var fileVal = $("#FILE_IBA_IDScan").val();
					if("" == fileVal){
						alert("请选择身份证扫描件!");
						return false;
					}
					
					fileVal = $("#FILE_IBA_Photo").val();
					if("" == fileVal){
						alert("请选择照片!");
						return false;
					}
					//alert(fileVal);
					var upfile = fileVal.toUpperCase();
					//alert(upfile);
					//alert(upfile.length);
					var index = upfile.lastIndexOf(".JPG");
					if(upfile.length != (index + ".JPG".length)){
						alert("请选择JGP格式的照片!");
						return false;
					}
				},
				success:function (data){
					//alert(data);
					if(data.indexOf("ERROR:") != -1){
						alert(data);
					}else{
						refeBrowse();
						$('#browseCreateUser').window('close');
					}
				}
			});
			//$('#amCreateProject').form('submit');
			//$('#amCreateUser').submit();
		}
		function clearForm(){
			$('#amCreateUser').form('clear');
		}

		function browseCreateUser(){
			  $('#browseCreateUser').window({
				     collapsible:false,
				     minimizable:false,
				     maximizable:false,
				     resizable:false,
				     title:"创建人员",
					 width:580,
				     height:650,
				     top:($(window).height() - 500),
				     draggable:true,
				     modal:true,
				     left:($(window).width() - 600),
				     onClose:function(){
				  refeBrowse();
				  	 $('#browseCreateUser').window("destroy");
				     }
				 });
		}



		function refeBrowse(){
			$("#cmTabs").tabs('select',"人员信息");  
	        var tab = $('#cmTabs').tabs('getSelected');       
	        $("#cmTabs").tabs('update',{  
	        tab:tab,  
	        options:{  
	           title:'人员信息',  
	           style:{padding:'1px'},  
	       //href:URL, // 使用href会导致页面加载两次，所以使用content代替   
	           content:'<iframe name="indextab" scrolling="auto" frameborder="0" style="width:100%;height:100%;"></iframe>',  
	       closable:false,  
	       fit:true,  
	       selected:true,  
	       closable:true
	        }  
	         });  
		}
	</script>
	
</div>
</div>
</center>
</body>
</html>